package 框架.ES检索;

import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

@SpringBootTest
public class ChargingProgressTests {
    @Autowired
    ChargingProgressRepository chargingProgressRepository;

    @Test
    public void testFind(){
        List<ChargingProgress> list = chargingProgressRepository.findByTemperatureGreaterThan(48L);
        System.out.println(list);
    }

    @Test
    public void testInsert(){
        ChargingProgress chargingProgress = new ChargingProgress();
        chargingProgress.setId(2L);
        chargingProgress.setUserId(2L);
        chargingProgress.setGunId(2L);
        chargingProgress.setTemperature(50L);
        chargingProgressRepository.save(chargingProgress);

        chargingProgress.setId(3L);
        chargingProgress.setUserId(3L);
        chargingProgress.setGunId(3L);
        chargingProgress.setTemperature(51L);
        chargingProgressRepository.save(chargingProgress);
    }
}

